package com.dongdongshop.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

@Configuration
public class FreemarkerConfig {
    @Value("${freemarker.templateloaderPath}")
    private String templateloaderPath;
    @Value("${freemarker.defaultEncoding}")
    private String defaultEncoding;


    @Bean
    public FreeMarkerConfigurer getFreeMarkerConfigurer(){
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        configurer.setTemplateLoaderPath(templateloaderPath);
        configurer.setDefaultEncoding(defaultEncoding);
        return configurer;
    }
}
